package com.caifu.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 组织架构表
 * </p>
 *
 * @author tww
 * @since 2021-03-01
 */
@Data
public class SysOrganization extends Model<SysOrganization> {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 组织名称
     */
    private String name;

    /**
     * 父id
     */
    private Integer pid;

    /**
     * 备注
     */
    private String remark;

    /**
     * 状态（1正常9删除）
     */
    private String status;

    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    /**
     * 更新时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    /**
     * 祖籍列表
     */
    private String ancestors;


    @TableField(exist = false)
    private List<SysOrganization> children;


    @TableField(exist = false)
    private List<SysOrganization> sysOrganizations = new ArrayList<SysOrganization>();
}
